close[x]


PHP

PHP-Home PHP-Environment Setup PHP-Syntax PHP-Run PHP in XAMPP PHP-Variable PHP-Comment PHP-Datatype PHP-String PHP-Operators PHP-Decision PHP-loop PHP-Get/Post PHP-Do While loop PHP-While loop PHP-For loop PHP-Foreach loop PHP-Array PHP-Multidimensional Arrays PHP-Associative Arrays PHP-Indexed Arrays PHP-Function PHP-Cookies. PHP-Session PHP-File upload PHP-Email PHP-Data & Time PHP-Include & Require PHP-Error PHP-File I/O PHP-Read File PHP-Write File PHP-Append & Delete File PHP-Filter PHP-Form Validation PHP-MySQl PHP-XML PHP-AJAX



learncodehere.com



PHP - Array

Arrays in PHP is a type of data structure that allows us to store multiple elements of similar data type under a single variable.

The arrays are helpful to create a list of elements of similar types, which can be accessed using their index or key.

PHP array is an ordered map (contains value on the basis of key).

There are three different kind of arrays in PHP:

  • Numeric array (Indexed) : An array with a numeric index where values are stored linearly.
  • Associative array : An array with a string index where instead of linear storage.
  • Multidimensional array : An array which contains single or multiple array within it and can be accessed via multiple indices..
  • The following chapters will explain and give examples of each loop type.